package reviewdemo1;

public class GirlFriend {
    private String name;
    private int age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int a) {
        if(a>=18 && a<=40)
        {
            age = a;
        }
        else
        {
            System.out.println("非法");
        }

    }

}
